<!DOCTYPE html>
<html>

<head lang="en">
  <meta charset="UTF-8">
  <title>replace & clone</title>
  <script src="js/jquery-1.11.3.js"></script>
  <style>
    body {
      text-align: center;
    }
  </style>
</head>

<body>
  <h1>替换节点</h1>

  <div id="chosen">
    <img src="img/p0.png">
  </div>
  <hr />
  <div id="list">
    <img src="img/p3.png">
    <img src="img/p4.png">
    <img src="img/p5.png">
  </div>

  <script>
    $("#list img").click(function () {
      // $(this).clone().replaceAll($("#chosen img"));
      $("#chosen img").replaceWith($(this).clone());
    });
  </script>
</body>

</html>